home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.7 KB | 72 lines | [TEXT/ttxt] |
- in module DemoModule
-
- --*******************************************************************************
- --* Class name: AnimatedButton
- --*
- --* Inherits from: Animation, Button and Rollover
- --* Class type: Concrete
- --* Component: User Interface
- --*
- --* Description: This class is an example of how to mix in the Button class
- --* the Rollover class with an animation to produce a button that
- --* animates when the mouse enters or leaves its boundary.
- --*
- --* Usage: ab := new AnimatedButton series:<a series of bitmaps> \
- --* pressedBitmap:<some bitmap>
- --*
- --* IVs:
- --*
- --* Methods: setPressedAppearance
- --* setReleasedAppearance
- --*
- --* Required files: animate.sx
- --* button.sx
- --* rollover.sx
- --*
- --* Notes:
- --*
- --* Author: Su Quek - Kaleida Labs, Inc.
- --*******************************************************************************
- class AnimatedButton (Animation, Button, Rollover)
- end
-
- -- The following methods are specialized to handle the animation with the
- -- the button functionality.
- -- In this example, when the button is pressed, a red stroke appears around
- -- the bitmap.
-
- method setReleasedAppearance self {class AnimatedButton} ->
- (
- nextmethod self
- self.boundary := self.series[self.cell]
- self.stroke := undefined
- )
-
- method setPressedAppearance self {class AnimatedButton} ->
- (
- nextmethod self
- self.stroke := (new Brush color:redColor)
- )
-
- method press self {class AnimatedButton} ->
- (
- nextmethod self
- stop self
- )
-
- method init self {class AnimatedButton} #rest args ->
- (
- apply nextmethod self args
-
- self.enterAction := start
- self.exitAction := stop
- self.authordata := self
-
- self
- )
-
-
-
-
-
-